package cn.wusifx.zabbix.request.builder.host;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/host/create
 */
public class HostCreateRequestBuilder extends CreateRequestBuilder {
    private String host;
    private List<Map<String,Object>> groups;
    private List<Map<String,Object>> interfaces;
    public HostCreateRequestBuilder(String auth) {
        super("host.create", auth);
    }

    public HostCreateRequestBuilder(Long id, String auth) {
        super("host.create", id, auth);
    }

    public String getHost() {
        return host;
    }

    public HostCreateRequestBuilder setHost(String host) {
        this.host = host;
        return this;
    }

    public List<Map<String, Object>> getGroups() {
        return groups;
    }

    public HostCreateRequestBuilder setGroups(List<Map<String, Object>> groups) {
        this.groups = groups;
        return this;
    }

    public List<Map<String, Object>> getInterfaces() {
        return interfaces;
    }

    public HostCreateRequestBuilder setInterfaces(List<Map<String, Object>> interfaces) {
        this.interfaces = interfaces;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("host",host);
        baseRequest.getParams().put("interfaces",interfaces);
        baseRequest.getParams().put("groups",groups);
        return baseRequest;
    }
}
